<template>
  <div id="app">
    <header class="app-header">
      <h1>{{ appInfo }}</h1>
      <p class="subtitle">学习 Vuex 状态管理</p>
    </header>
    
    <main class="app-main">
      <Counter />
      <User />
    </main>
    
    <footer class="app-footer">
      <p>Vuex 核心概念：State, Getters, Mutations, Actions, Modules</p>
    </footer>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import Counter from './components/Counter.vue'
import User from './components/User.vue'

export default {
  name: 'App',
  components: {
    Counter,
    User
  },
  computed: {
    ...mapGetters(['appInfo'])
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  color: white;
  margin-bottom: 32px;
  padding: 32px 0;
}

.app-header h1 {
  font-size: 36px;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 18px;
  opacity: 0.9;
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-footer {
  text-align: center;
  color: white;
  margin-top: 32px;
  padding: 24px;
  opacity: 0.8;
  font-size: 14px;
}

/* 响应式设计 */
@media (min-width: 768px) {
  .app-main {
    flex-direction: row;
  }
  
  .app-main > * {
    flex: 1;
  }
}
</style>

